#include "HeroModel.h"

HeroModel::HeroModel()
    : m_hp(0)
    , m_att(0)
{
}

HeroModel::~HeroModel()
{
}

void HeroModel::beAttack(int att)
{
    if (att < 0)
    {
        return;
    }
    m_hp -= att;
    m_hp = (m_hp < 0) ? 0 : m_hp;
}

bool HeroModel::dead() const
{
    return false;
}

void HeroModel::setName(const std::string& name)
{
    m_name = name;
}

const std::string HeroModel::getName() const
{
    return m_name;
}

void HeroModel::setAtt(int att)
{
    m_att = att;
}

int HeroModel::getAtt() const
{
    return m_att;
}
